const {delay} = require('../utils');
function responseTimeMiddleware() {
  return async function (req, res, next) {
    const reqTime = Date.now();
    await delay();
    await next();
    const resTime = Date.now();
    console.log(`response time logger: ${resTime-reqTime}ms`);
  }
}

module.exports = {
  responseTimeMiddleware
}